// 引入模块
let fs = require("fs")

// 判断账号密码是否正确
let user = { "uername": 'xiaoming11', "password": "1111" }

let data = fs.readFileSync(__dirname + "/persons.json");

let arr = JSON.parse(data.toString());

// 遍历判断

for (item of arr) { 
    if (user.uername == item.username && user.password == item.password) {
        console.log("注册成功");
        return
    } else { 
        console.log("注册失败");
        return
    }
}